package us.icitap.commandcenter.ui.dispatcher;

import java.util.List;

import us.icitap.commandcenter.business.ejb.persistence.Call;
import us.icitap.commandcenter.ui.custom.CustColumnGenerator;
import us.icitap.commandcenter.ui.custom.CustTable;
import us.icitap.commandcenter.ui.shared.CallTable;

import com.vaadin.data.util.BeanItemContainer;

public class StartedVerificationTable extends CallTable{
	
	private final BeanItemContainer<Call> beans = new BeanItemContainer<Call>(Call.class);

	public StartedVerificationTable(boolean oneDispatcher) {
		super("Totali i telefonatave me status NE PRITJE PER VERIFIKIM: ");

		this.addGeneratedColumn("relatedCallNr", CustColumnGenerator.relatedCallNumberColumnGenerator);
		this.addGeneratedColumn("whoIsNotified", CustColumnGenerator.notificationColumnGenerator);
		if(!oneDispatcher){
			this.setVisibleColumns(new Object[]{"relatedCallNr","caller", "address", "description", "callReason", "mainDispatcher", "whoIsNotified", "recordDate", "startedVerificationUser" });
			this.setColumnHeaders(new String[]{"NR I TEL","TELEFONUESI", "ADRESA", "PERSHKRIMI", "ARSYEJA E TELEFONATES", "ZONA MBULIMIT", "NJOFTUAR", "DT. REGJ.", "SHPERNDARESI"});
			this.addGeneratedColumn("mainDispatcher", CustColumnGenerator.dispatcherColumnGenerator);
		}
		else{
			this.setVisibleColumns(new Object[]{"relatedCallNr","caller", "address", "description", "callReason", "whoIsNotified", "recordDate", "startedVerificationUser" });
			this.setColumnHeaders(new String[]{"NR I TEL",   "TELEFONUESI", "ADRESA", "PERSHKRIMI", "ARSYEJA E TELEFONATES", "NJOFTUAR", "DT. REGJ.","SHPERNDARESI"});
		}
		
		this.addGeneratedColumn("caller", CustColumnGenerator.callerColumnGenerator);
		this.addGeneratedColumn("callReason", CustColumnGenerator.callReasonColumnGenerator);
		
		this.setPageLength(5);
		this.setWidth("980px");
		this.setColumnWidth("relatedCallNr", 30);
		this.setColumnWidth("caller", 100);
		this.setColumnWidth("callReason", 100);
		this.setColumnWidth("address", 200);
		this.setColumnWidth("description", 200);
		
		this.updateTable();
		this.setSelectable(true);   
		this.setImmediate(true);
		
		this.addStyleName("yellow");
		
		
	}
	
	
}
